﻿using System;

namespace LB.Common
{
    public class LoginToken
    {
        public User User { get; set; }

        public string SessionId { get; set; }

        public DateTime StartTime { get; set; }

        public TimeSpan SessionDuration { get; set; }

        public DateTime EndTime { get { return StartTime + SessionDuration; }}

        public LoginToken(User user, TimeSpan duration)
        {
            User = user;
            SessionId = Guid.NewGuid().ToString();
            StartTime = DateTime.Now;
            SessionDuration = duration;
        }

        public LoginToken(){}
    }
}
